﻿@using Mysoft.Platform.Component.Extensions
<!DOCTYPE html>
<html>
	<head>
		<title>@ViewBag.Title</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
		<!--[if lt IE 9]>
			<script src="@Url.Content("~/Content/bootstrap/js/html5shiv.js")"></script>
		<![endif]-->
		<link href="@Url.Content("~/Content/bootstrap/css/bootstrap.min.css")" rel="stylesheet" type="text/css" />
		<link href="@Url.Content("~/Content/bootstrap/css/bootstrap-responsive.min.css")" rel="stylesheet" type="text/css" />
		<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
		
		<!--http://code.jquery.com/jquery.js-->
		<script src="@Url.Content("~/Scripts/jquery.js")" type="text/javascript"></script>
		<script src="@Url.Content("~/Content/bootstrap/js/bootstrap.min.js")" type="text/javascript"></script>

		<script type="text/javascript">
		    window.onload = function () {
		        $("#@ViewContext.RouteData.Values["controller"]").attr("class","active");
		    };
		    window.onscroll = function() {
		        var top = document.documentElement.scrollTop || document.body.scrollTop;  
		        if(top) {
		            $("#subnav").attr("class", "navbar-fixed-top subnavbar-fixed");    
		        } else {
		            $("#subnav").attr("class", "container body-placeholder");
		        }
		    };
		</script>
	</head>

	<body>
		<!-- Navbar
		================================================== -->
		
		<div class="navbar navbar-inverse navbar-fixed-top">
			<div class="navbar-inner">
				<div class="container">
					<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<a class="brand" href="/">Mysoft Library</a>

					<div class="nav-collapse collapse">
						<form class="navbar-form pull-right" action="@Url.Action("Search", "Home")">
							<input type="text" placeholder="请输入书名" name="bookName"/>
							<input type="submit" class="btn btn-inverse" value="图书搜索" />
						</form>
					</div>
				</div>
			</div>
		</div>
		
		<div class="container body-placeholder" id="subnav">
			<div class="container">
				<ul class="nav nav-pills simple-bar" id="navbar">
					<script type="text/javascript">
					    $.ajax({
					        url: '@Url.Action("Index", "Menu")',
					    }).done(function(data) {
					        for (var i = 0; i < data.length; i++) {
					            $('#navbar').append('<li id="' + data[i].Id + '"><a href="' + data[i].Link + '">' + data[i].Name + '</a></li>');
					        }
					    });
					</script>
				</ul>
			</div>
		</div>
		
		<div class="container">
			@RenderBody()
		</div>
		
		<script src="@Url.Content("~/Scripts/common/global.js")" type="text/javascript"></script>

	</body>
</html>
